package cn.online.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;


@Entity
@Table(name = "problem")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Problem implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer pid;
	private Student student;
	private Course course;
	private String ptitle;
	private String pcontent;
	private Integer pfinish;
	private Date pdate;

	public Problem() {
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "p_id", nullable = false, updatable = false)
	public Integer getPid() {
		return this.pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	@ManyToOne
	@JoinColumn(nullable = false,name = "p_student")
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@ManyToOne
	@JoinColumn(nullable = false,name = "p_course")
	public Course getCourse() {
		return this.course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	@Column(name = "p_title", nullable = false, length = 100)
	public String getPtitle() {
		return this.ptitle;
	}

	public void setPtitle(String ptitle) {
		this.ptitle = ptitle;
	}

	@Column(name = "p_content", nullable = false)
	public String getPcontent() {
		return this.pcontent;
	}

	public void setPcontent(String Pcontent) {
		this.pcontent = Pcontent;
	}

	@Column(name = "p_finish", nullable = false)
	public Integer getPfinish() {
		return this.pfinish;
	}

	public void setPfinish(Integer pfinish) {
		this.pfinish = pfinish;
	}

	
	@Column(name = "p_date",nullable = false, updatable = false)
	public Date getPdate() {
		return this.pdate;
	}

	public void setPdate(Date pdate) {
		this.pdate = pdate;
	}

}